<div class="page user-painel">
    <div class="box-user">
        <div class="box-header">
            <h2 class="col-xs-12 box-title">Pagamentos</h2>

        </div>
        <div class="col-md-8 col-xs-12 col-lg-9">
            <div class="">
                <strong>Informações </strong><br/>
                <strong>Comitente: </strong><?php echo $lotes['0']->NOME_FANTASIA; ?><br/>
                <strong>Data do Leilão: </strong><?php echo auto_format_data($lotes['0']->DATA_LEILAO, '-', '/'); ?>

            </div>

        </div>
        <div class="col-md-4 col-xs-12 col-lg-3">
            <strong>Pagamento #<?php echo str_pad($cod_payment, 8, 0, STR_PAD_LEFT); ?></strong>
            <br/>
            <br/>
            <strong>Código Autenticação: </strong><?php echo $hash_payment; ?><br/>
            <strong>Gerado: </strong><?php echo auto_format_data($date_payment, '-', '/'); ?><br/><br/>

        </div>

        <div class="clearfix"></div>
        <div class="col-xs-12 col-md-12 table-responsive">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th class="col-xs-1">Qtd</th>
                        <th>Cód. Lote</th>
                        <th>Num. Lote</th>
                        <th>Descricação Lote</th>
                        <th class="col-md-2" style="text-align: right;">Subtotal</th>
                    </tr>                                    
                </thead>
                <tbody>
                    <?php
                    $sum_taxas = 0;
                    $sum_subtotal =0;
                    $sum_comissao = 0;
                    ?>
                    <?php if ($lotes): ?>
                        <?php foreach ($lotes as $key => $row): ?>  
                          <?php $taxa= get_taxa($row->TOTAL); $sum_taxas+=$taxa; ?>
                           <?php $sum_subtotal += $row->TOTAL; $sum_comissao+= $row->COMISSAO;  ?>
                            <tr>
                                <td>1</td>
                                <td><?php echo $row->LOTE_ID; ?></td>
                                <td><?php echo $row->NUM_LOTE; ?></td>
                                <td><?php echo $row->DESCRICAO; ?></td>
                                <td style="text-align: right;"><?php echo number_format($row->TOTAL,2,',','.'); ?>(BRL)</td>

                            </tr>
                        <?php endforeach; ?>   
                    <?php endif; ?>
                </tbody>
            </table> 
          </div> 
        <div class="col-xs-8">
            <p class="lead">Metodos de Pagamentos</p>
            <a title="<?php  echo Utils::message('title_link_generate_bolet'); ?>" class="link-payment" 
              click-show-boleto   
               href="#" data-url="<?php echo site_url('boleto-'.$hash_payment.'_ajax'); ?>" >
                <?php echo add_image('system/boleto.png', 'style="width:51px;"'); ?> 
            </a>
            <div class="clearfix">&nbsp;</div>
            <div class="alert alert-danger">
                <?php  echo Utils::message('info_generate_boleto'); ?>
            </div>
            
        </div>
        
        <div class="col-xs-4">
            <div class="table-responsive">
                 <p class="lead">Totais</p>
                <table class="table">
                    <tr>
                        <td><strong>Subtotal</strong></td>
                        <td><?php echo number_format($sum_subtotal,2,',','.'); ?>(BRL)</td>        
                    </tr>
                    <tr>
                        <td><strong>Comissão</strong></td>
                        <td><?php echo number_format($sum_comissao,2,',','.'); ?>(BRL)</td>        
                    </tr>
                    <tr>
                        <td><strong> Taxa Adm. </strong></td>
                        <td><?php echo number_format($sum_taxas,2,',','.'); ?>(BRL)</td>        
                    </tr>
                    
                    <tr>
                        <td><strong>Total</strong></td>
                        <td><?php echo number_format($sum_comissao + $sum_subtotal + $sum_taxas,2,',','.'); ?>(BRL)</td>        
                    </tr>
                
            </table>
                
            </div>
            
            
        </div>
        
        <div class="clearfix"></div><br>
    </div>

</div>

<?php

add_js('plugins/frontend/jquery.mousewheel.min', 'footer', 11);
add_js('plugins/frontend/jquery.jqzoom-core', 'footer', 11);
add_js('plugins/frontend/fancybox/jquery.fancybox', 'footer', 6);
add_js('plugins/frontend/fancybox/jquery.fancybox-buttons', 'footer', 9);
add_js('plugins/frontend/fancybox/jquery.fancybox-media', 'footer', 9);
add_js('plugins/frontend/fancybox/jquery.fancybox-thumbs', 'footer', 9);
add_js('plugins/frontend/jquery.maskMoney', 'footer', 9);
add_js('scripts/user/jquery.pagamentos', 'footer', 9);
add_css('frontend/fancybox/jquery.fancybox', 'header', 13);
add_css('frontend/fancybox/helpers/jquery.fancybox-buttons', 'header', 14);
add_css('frontend/fancybox/helpers/jquery.fancybox-thumbs', 'header', 15);
add_css('frontend/jquery.jqzoom', 'footer', 16);